var setting = {
    openContainer: function (obj) {
        var oThis = obj;
        if (oThis.hasClass("active")) {
            oThis.removeClass("active");
            $("#setting-container").hide();
        } else {
            page.initialStatus("setting");
            $("#setting-container").show();
            oThis.parents("#switch-box").find(".bar-item").removeClass("active");
            oThis.addClass("active");
        }
    },
    closeContainer: function () {
        $("#setting-container").hide();
        $("#setting").removeClass("active");
    },
    earthChange:function(This){
    	var oThis = $(This);
    	var oValue = oThis.val();
    	oThis.css({"background-size":""+oValue+"% 100%"});
    	if(oValue==100){
    		//地下模型不显示 
    		var allModel = aObj;
    		var sceneBox=$("#sceneBox .layer-item-title");
    		for(var a=0;a<sceneBox.length;a++){
    			var oType=sceneBox.eq(a).attr("type");
    			if(oType==2){
        			var modelId = sceneBox.eq(a).attr("guid");
        			var currentModel = aObj[modelId];
        			if(currentModel.name.underground=="2"){
        				currentModel.show=false;
        			}
    			}
    		}
            viewer.scene.setSurfaceTransparency.surfaceTransparency = 0;
            viewer.scene.setSurfaceTransparency.enabled =true;
    	}else if(oValue==0){
            viewer.scene.setSurfaceTransparency.surfaceTransparency = 1;
            viewer.scene.setSurfaceTransparency.enabled =false;
    		//地上模型不显示
    		var allModel = aObj;
    		var sceneBox=$("#sceneBox .layer-item-title");
    		for(var a=0;a<sceneBox.length;a++){
    			var oType=sceneBox.eq(a).attr("type");
    			if(oType==2){
        			var modelId = sceneBox.eq(a).attr("guid");
        			var currentModel = aObj[modelId];
        			if(currentModel.name.underground=="1"){
        				currentModel.show=false;
        			}
    			}
    		}
    	}else{
            viewer.scene.setSurfaceTransparency.surfaceTransparency = (1-oValue/100);
            viewer.scene.setSurfaceTransparency.enabled =true;
    		//地上模型不显示
    		var allModel = aObj;
    		var sceneBox=$("#sceneBox .layer-item-title");
    		for(var a=0;a<sceneBox.length;a++){
    			var oType=sceneBox.eq(a).attr("type");
    			if(oType==2){
        			var modelId = sceneBox.eq(a).attr("guid");
        			var currentModel = aObj[modelId];
        			var modelHtml = $("#sceneBox").find(".layer-item-title");
        		
        			for(var i=0;i<modelHtml.length;i++){
        				if(modelHtml.eq(i).attr("guid")==modelId){
        					var isObjVisible = modelHtml.eq(i).find

(".checkicon").hasClass("active");
        					if(isObjVisible){
        						currentModel.show=true;
        					}else{
        						currentModel.show=false;
        					}
        				}
        			}
    			}
    		}
            /*viewer.scene.setSurfaceTransparency.surfaceTransparency = oValue;*/
    	}
    	oThis.next().html(oValue+"%");
    },
    init: function () {
        //设置开 
        $("#setting").on("click", function () {
            setting.openContainer($(this));
        });
        //关闭设置 
        $("#setting-container .comment-close").on("click", function () {
            setting.closeContainer();
        });


        //图层悬浮窗打开及关闭  设置中图层管理侧栏开关
        $("#setting-container").on("click", ".EarthFoot>div", function () {
            var oThis = $(this);
            if (!oThis.hasClass("active")) {
                if (oThis.find("i").hasClass("hid")) {
                    //隐藏 
                    $(".floatScrollBox,.analysis-panel").hide();
                } else {
                    //显示 
                    $(".floatScrollBox,.analysis-panel").show();
                }
                oThis.parent().find("div").removeClass("active");
                oThis.addClass("active");
            }
        });
    }
}